import moment from 'moment'

// 通过blob下载文件
export function downloadBlobFile(res: Blob, name: string): void {
  const url = URL.createObjectURL(res)
  const link = document.createElement('a')
  const time = moment().format('YYYYMMDDHHmm')
  link.download = `${name}_${time}.xlsx`
  link.href = url
  link.click()
  URL.revokeObjectURL(link.href)
}
